/**
 * Created by Freeman on 2016/7/29.
 */
import React, {Component, PropTypes} from 'react'
class Card extends Component {
    constructor(props, context) {
        super(props, context);
    }

    handleChange(e){
        let input = e.target.value;
        this.props.actions.search(input);
    }
    render() {
        const {auth} = this.props;
        return (
            <div className="m-card">
                <header>
                    <img className="avatar" width="40" height="40" src={auth.user.img}/>
                    <p className="name">{auth.user.name}</p>
                </header>
                <footer>
                    <input className="search" type="text" placeholder="search user..." onChange={this.handleChange.bind(this)}  />
                </footer>
            </div>
        )
    }
};

Card.propTypes = {
    auth:PropTypes.object.isRequired,
    actions:PropTypes.object.isRequired
};

export default Card;